package co.edu.udistrital.analyzer.business.orm.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import co.edu.udistrital.analyzer.business.orm.model.enums.ParamName;

@Entity
@Table(name="parametros")
@NamedQueries({
	@NamedQuery(name="findParamByKey", query="select p from Param p where p.key = :key")})
public class Param implements Serializable {

	/**
	 * The serial version
	 */
	private static final long serialVersionUID = -1319576106641048401L;

	/**
	 * The param id
	 */
    @Id
    @Column(name="id_parametro", precision=18, scale=0)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	/**
	 * The key for this param
	 */
    @NotNull
    @Column(name="llave", length=255, nullable= false)
    @Enumerated(EnumType.STRING)
	private ParamName key;
	
	/**
	 * The value for this param
	 */
    @NotNull
    @Length(max=255)
    @Column(name="valor", length=255, nullable= false)
	private String value;

	/**
	 * @return Retorna el valor de id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @return Retorna el valor de key
	 */
	public ParamName getKey() {
		return key;
	}

	/**
	 * @return Retorna el valor de value
	 */
	public String getValue() {
		return value;
	}

	/**
	 * Asigna un nuevo valor aid
	 * 
	 * @param id Nuevo valor de id
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * Asigna un nuevo valor akey
	 * 
	 * @param key Nuevo valor de key
	 */
	public void setKey(ParamName key) {
		this.key = key;
	}

	/**
	 * Asigna un nuevo valor avalue
	 * 
	 * @param value Nuevo valor de value
	 */
	public void setValue(String value) {
		this.value = value;
	}

}
